home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / doc / gs-esp / HACKING < prev    next >
Encoding:
Text File  |  2005-03-04  |  1.4 KB  |  52 lines

  1. HACKING - ESP Ghostscript Coding Rules
  2. --------------------------------------
  3.  
  4. This file describes the basic coding rules for all contributions
  5. to ESP Ghostscript.  These rules MUST be followed to ensure that
  6. ESP Ghostscript can be compiled and used on as many platforms as
  7. possible.
  8.  
  9. 1. All C source files and headers MUST only use features from ANSI C.
  10.    You may not use features specific to GCC or C99, including:
  11.  
  12.    a. C++ COMMENTS FORBIDDEN; you may not use the C++/C99 comment
  13.       prefix "//".  Instead, use "/* your comment */".
  14.  
  15.    b. MIXING DECLARATIONS AND CODE; you may not define a variable in
  16.       the middle of a code block, for example:
  17.  
  18.           int i;
  19.           i = 0;
  20.           int j;
  21.           j = 0;
  22.  
  23.       is not valid ANSI C code while:
  24.  
  25.           int i = 0;
  26.           int j = 0;
  27.  
  28.       and:
  29.  
  30.           int i;
  31.           int j;
  32.           i = 0;
  33.           j = 0;
  34.  
  35.       *are* valid ANSI C.
  36.  
  37.    c. VARIABLE DECLARATIONS IN FOR LOOPS; variable declarations in "for"
  38.       loops are not allowed in ANSI C, for example:
  39.  
  40.           for (int i = 0; i < 10; i ++)
  41.  
  42.       is not valid ANSI C.
  43.  
  44.    d. INLINE IS NOT A SUPPORTED KEYWORD; the "inline" keyword is not
  45.       part of ANSI C, but is a GCC and C99 extension.
  46.  
  47. 2. Operating-system-specific code must be #ifdef'd, either using
  48.    the corresponding system define(s) or via autoconf tests.
  49.  
  50. 3. All code/modules/drivers must be provided under the GPL, LGPL, or
  51.    GNU-compatible license.
  52.